#include <stdio.h>
int main()
{
int i=0,n;
char str[1000];
gets(str);
while (str[i]==' ') i++;
while (str[i]!='\0')  
{
	if (str[i]!=' ')
	{
	n++;
	while(str[i]!=' ')
	 {
	 	if(str[i]=='\0')  break;
		 i++; 
	 }
    }
    else 
	  {
    	while(str[i]==' ')  i++;
	  } 
}
printf("%d\n",n);
	 
}

